package 文件字符流;

import java.io.FileReader;
import java.io.IOException;

public class demo1 {
    public static void main(String[] args) {
        FileReader fileReader = null;
        try {
            fileReader = new FileReader("temp");
            char[] chars = new char[4];
            int fileReaderCount = 0;
            while ((fileReaderCount = fileReader.read(chars))!=-1){
                System.out.println(new String(chars,0,fileReaderCount));
            }
        } catch (IOException e) {
            e.printStackTrace();
        }finally {
            if (fileReader != null){
                try {
                    fileReader.close();
                } catch (IOException e) {
                    e.printStackTrace();
                }
            }
        }
    }
}
